//对象  ===== 可以改变state的初始值的方法  具体的用法就是给里面的方法传入参数state或额外的参数,然后利用vue的双向数据驱动进行值的改变
//定义修改的操作
import * as types from './mutation-types'

//matutaions是个修改方法的对象
const mutations = {
  [types.SET_SINGER](state, singer) {
    state.singer = singer
  },
  //播放/暂停
  [types.SET_PLAYING_STATE](state, flag) {
    state.playing = flag
  },
  [types.SET_FULL_SCREEN](state, flag) {
    state.fullScreen = flag
  },
  [types.SET_PLAYLIST](state, list) {
    state.playlist = list
  },
  [types.SET_SEQUENCE_LIST](state, list) {
    state.sequenceList = list
  },
  [types.SET_PLAY_MODE](state, mode) {
    state.mode = mode
  },
  [types.SET_CURRENT_INDEX](state, index) {
    state.currentIndex = index
  },
  [types.SET_DISC](state, disc) {
    state.disc = disc
  },
  [types.SET_DESC](state, desc) {
    state.desc = desc
  },
  // [types.SET_PURLURL](state, purlurl) {
  //   state.purlurl = purlurl
  // },
  [types.SET_TOP_LIST](state, topList) {
    state.topList = topList
  },
  [types.SET_SEARCH_HISTORY](state, history) {
    state.searchHistory = history
  },
  [types.SET_PLAY_HISTORY](state, history) {
    state.playHistory = history
  },
  [types.SET_FAVORITE_LIST](state, list) {
    state.favoriteList = list
  },
  [types.SET_DISC_LISTS](state, list) {
    state.discLists = list
  },
  [types.SET_LYRIC](state, lyric) {
    state.lyric = lyric
  },
  [types.SET_SEARCH](state, search) {
    state.search = search
  },
}

export default mutations
